//消息列表
'use strict';
import React,{Component} from 'react';
import Header from '../common/header';
import styles from '../style/styles';
import * as URLconstant from '../constant/URLconstant';
import Util from '../common/util';
import {
    View,
    Image,
    TouchableOpacity,
    Text
} from 'react-native';
export default class newsList extends Component{
    // 构造
      constructor(props) {
        super(props);
        // 初始状态
        this.state = {
            newsList:[1,2,3,4]
        };
      }

    newsList(){
        let that = this;
        let newsList = that.state.newsList;
        let rows;
        let list=[]
        for(let item of newsList){
            rows=(
                <View key={item} style={styles.news_box_list_wrap}>
                    <Text style={styles.news_time}>2017-02-02 12:00:00</Text>
                    <View style={styles.white_box}>
                        <Text style={styles.news_box_title} numberOfLines={1}>我是产品标题我是产品标题我是产品标题我是产品标题我是产品标题</Text>
                        <View style={styles.news_box_box}>
                            <Image
                                style={styles.news_goods_img}
                                resizeMode={'cover'}
                                source={{uri:'http://cdn.img.ecduo.cn/ecduo/Uploads/Picture/2017-02/58b51217412cc.jpg?x-oss-process=image/resize,m_fill,h_250,w_250'}}
                            />
                            <Text numberOfLines={2} style={styles.news_box_txt3}>消息内容消息内容消息内容消息内容消息内容消息内容消息内容消息内容消息内容消息内容消息内容消息内容消息内容消息内容消息内容消息内容</Text>
                        </View>
                    </View>
                </View>
            )
            list.push(rows)
        }
        return list
    }

    render(){
        return(
            <View style={styles.news_box_flex}>
                <Header navigator={this.props.navigator}  initObj={{ title:this.props.title,id:2}}/>
                {this.newsList()}
            </View>
        )
    }
}